package com.qf.api.controller;

import com.qf.api.feign.ProductFeign;
import com.qf.api.service.ProductService;
import com.qf.common.bean.R;
import com.qf.common.dto.ProductDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 千锋健哥
 */
@RestController
@RequestMapping("/api/product")
public class ProductController {

    @Autowired
    private ProductService productService;

    @PostMapping("/all")
    public R<List> findAreaAll(@RequestBody(required = false) ProductDto dto) {
        if (dto == null) {
            dto = new ProductDto();
        }

        R<List> result = productService.findAreaAll(dto);
        return result;
    }
}
